<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Economic Analysis of the Jia Family Decline</title>
    <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+Pro:wght@400;600&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="styles.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
    <!-- Header Section -->
    <header class="main-header">
        <div class="header-banner">
            <h1>Economic Analysis of the Jia Family Decline</h1>
            <h2>A Study in Diminishing Marginal Utility</h2>
        </div>
        <nav class="main-nav">
            <ul>
                <li><a href="#introduction">Introduction</a></li>
                <li><a href="#visualizations">Visualizations</a></li>
                <li><a href="#analysis">Analysis</a></li>
                <li><a href="#principles">Principles</a></li>
                <li><a href="#conclusions">Conclusions</a></li>
            </ul>
        </nav>
    </header>

    <!-- Introduction Section -->
    <section id="introduction" class="introduction">
        <div class="container">
            <div class="intro-content">
                <div class="project-context">
                    <h2>Project Context</h2>
                    <div class="content-box">
                        <p>This analysis examines the economic decline of the Jia family from the classic Chinese novel "Dream of the Red Chamber" through the lens of modern economic theory. The study focuses particularly on the law of diminishing marginal utility and its manifestation in the family's consumption patterns.</p>
                        <p>The Jia family's trajectory from prosperity to decline provides a unique case study in how economic principles operate within a complex social and cultural context. Their story illustrates the practical implications of economic theories in real-world scenarios.</p>
                    </div>
                </div>
                <div class="key-findings">
                    <h2>Key Findings</h2>
                    <div class="content-box">
                        <ul>
                            <li>Clear demonstration of diminishing marginal utility across multiple consumption categories</li>
                            <li>Significant disparity between resource allocation and sustainable economic practices</li>
                            <li>Direct correlation between consumption patterns and economic decline</li>
                            <li>Evidence of failure to adapt to changing economic circumstances</li>
                            <li>Impact of social obligations on economic decision-making</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Visualizations Section -->
    <section id="visualizations" class="visualizations">
        <div class="container">
            <h2>Data Visualizations</h2>
            
            <div class="visualization-box">
                <h3>Wealth Consumption vs. Satisfaction Over Time</h3>
                <div class="chart-container">
                    <canvas id="wealthSatisfactionGraph"></canvas>
                </div>
                <div class="chart-description">
                    <p>This graph illustrates the relationship between the Jia family's wealth consumption and the satisfaction derived from it over time. The declining satisfaction levels despite continued high consumption demonstrate the law of diminishing marginal utility in action.</p>
                </div>
            </div>

            <div class="visualization-box">
                <h3>Distribution of Family Resources</h3>
                <div class="chart-container">
                    <canvas id="resourcePieChart"></canvas>
                </div>
                <div class="chart-description">
                    <p>The pie chart shows how the Jia family allocated their resources across different categories of expenditure, highlighting their priorities and patterns of consumption.</p>
                </div>
            </div>

            <div class="visualization-box">
                <h3>Initial vs Final Utility Values</h3>
                <div class="chart-container">
                    <canvas id="utilityBarGraph"></canvas>
                </div>
                <div class="chart-description">
                    <p>This comparison demonstrates the dramatic decline in utility value across various expenditure categories, showing how the family's investments yielded diminishing returns over time.</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Analysis Section -->
    <section id="analysis" class="analysis">
        <div class="container">
            <h2>Theoretical Analysis</h2>
            <div class="analysis-content">
                <div class="column">
                    <h3>Economic Principles</h3>
                    <div class="content-box">
                        ${theoretical_analysis_content}
                    </div>
                </div>
                <div class="column">
                    <h3>Novel Examples</h3>
                    <div class="content-box">
                        ${novel_examples_content}
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Economic Principles Section -->
    <section id="principles" class="principles">
        <div class="container">
            <h2>Economic Principles</h2>
            <div class="principles-grid">
                <div class="principle-card">
                    <h3>Diminishing Marginal Utility</h3>
                    <div class="content-box">
                        <p>The decrease in satisfaction gained from each additional unit of consumption, clearly demonstrated in the Jia family's luxury spending patterns.</p>
                    </div>
                </div>
                <div class="principle-card">
                    <h3>Opportunity Cost</h3>
                    <div class="content-box">
                        <p>The value of foregone alternatives, exemplified by the family's choice to maintain status through consumption rather than invest in sustainable ventures.</p>
                    </div>
                </div>
                <div class="principle-card">
                    <h3>Economic Sustainability</h3>
                    <div class="content-box">
                        <p>The balance between income and expenditure necessary for long-term financial stability, which the Jia family failed to maintain.</p>
                    </div>
                </div>
                <div class="principle-card">
                    <h3>Resource Allocation</h3>
                    <div class="content-box">
                        <p>The distribution of limited resources among competing uses, illustrated by the family's prioritization of social status over economic efficiency.</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Conclusions Section -->
    <section id="conclusions" class="conclusions">
        <div class="container">
            <h2>Conclusions</h2>
            <div class="key-takeaways">
                <h3>Key Takeaways</h3>
                <div class="content-box">
                    <ul>
                        <li>Economic principles are universal and timeless, as demonstrated by their clear manifestation in classical literature</li>
                        <li>Understanding diminishing marginal utility is crucial for sustainable resource management</li>
                        <li>Social obligations must be balanced against economic sustainability</li>
                        <li>Adaptation to changing economic circumstances is essential for long-term survival</li>
                        <li>The importance of maintaining productive assets over purely consumptive ones</li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer Section -->
    <footer class="main-footer">
        <div class="container">
            <div class="footer-content">
                <div class="references">
                    <h3>References</h3>
                    <div class="content-box">
                        <ul>
                            <li>Dream of the Red Chamber (红楼梦) by Cao Xueqin</li>
                            <li>Economic Principles in Literature Analysis</li>
                            <li>Historical Context of Qing Dynasty Economics</li>
                            <li>Modern Economic Theory Applications</li>
                        </ul>
                    </div>
                </div>
                <div class="credits">
                    <h3>Credits</h3>
                    <div class="content-box">
                        <p>Analysis and Visualization: Economic Theory Project</p>
                        <p>Data Collection: Literary Analysis Team</p>
                        <p>Web Development: Technical Implementation Team</p>
                    </div>
                </div>
            </div>
        </div>
    </footer>

    <button id="backToTop" class="back-to-top" aria-label="Back to top">↑</button>
    <script src="scripts.js"></script>
    <script src="charts.js"></script>
</body>
</html>